﻿<?php
//------- INIT

require_once("include.php");

//------- DATA VERIFICATION


//------- LOGIC
$name; // The name of the task
$description; // The description of the task
$assignedMember; // The person that should complete this task.

//Arrays of which chars that should be replaced with what
$search = array('<', '>');
$replace = array('&lt;', '&gt;');

//Check if the fields of the form is filled and with what
if($_POST['name']){
	$name = (str_replace($search, $replace, $_POST['name']);
}
if($_POST['description']){
	$startDate = (str_replace($search, $replace, $_POST['description']);
}
if($_POST['assignedMember']){
	$endDate = (str_replace($search, $replace, $_POST['assignedMember']);
}

if(!$_POST['name'] || !$_POST['assignedMember'] || !$_POST['description']){
	echo "Du har ikke udfyldt alle felter!"
}

//------- HTML
?>
<html>
<body>

<div id="top">
	<div id="topLeft">
		<form name="create_task" method="post" action="">
			Navn på opgaven:<br/>
			<input name="name" type="textarea"></textarea>
			<br/>
			Beskrivelse af opgaven:
			<input name="description" type="textarea" />
			Person som skal udføre opgaven:
			<input name="assignedMember" type="textarea" />
			<input type="submit" value="Post" />
		</form> 
	</div>
	<div id="topRight">
	</div>
</div>
<div id="bottom">
	<div id="bottomLeft">
	</div>
	<div id="bottomRight">
	</div>
</div>

</body>
</html>